<?php

namespace common\models\clinic;

use Yii;

/**
 * This is the model class for table "{{%clinic}}".
 *
 * @property int $id
 * @property string $name 诊室名称
 * @property int $project_id 所属项目
 * @property string $clinic_user 诊室人员【多个用','分割】
 * @property int $status 状态【-1删除、0禁用、1启用】
 * @property int $created_at 添加时间
 * @property int $updated_at 更新时间
 * @property int $sort 排序（升级）
 */
class Clinic extends \common\models\BaseModel
{
    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 失效
    const STATUS_ENABLE = 1;// 正常

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '停用',
        self::STATUS_ENABLE => '启用',
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%clinic}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['project_id', 'status', 'created_at', 'updated_at', 'sort'], 'integer'],
            [['name'], 'string', 'max' => 60],
            [['clinic_user'], 'string', 'max' => 200],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '诊室名称',
            'project_id' => '所属项目',
            'clinic_user' => '诊室人员【多个用\',\'分割】',
            'status' => '状态【-1删除、0禁用、1启用】',
            'created_at' => '添加时间',
            'updated_at' => '更新时间',
            'sort' => '排序（升级）',
        ];
    }
}
